@isTest
private class OpenCTIOperationTest {
    static testMethod void testMethod1() {
        Account acc = new Account();
        acc.Name = 'open cti test';
        insert acc;

        Contact con = new Contact();
        con.LastName = 'Mike';
        con.AccountId = acc.Id;
        con.Phone = '0123456789';
        con.MobilePhone = '9876543210';
        insert con;

        OpenCTIOperation.createCallHistory('0123456789', '呼入');
        List<CallHistory__c> ch = [select Id from CallHistory__c where Account__c = :acc.Id];
        System.assertEquals(1, ch.size());

        OpenCTIOperation.updateCallHistory(ch[0].Id);
    }
}